<template>
<div>
  <Head></Head>
<h5>请选择收货地址:</h5>
<el-radio-group v-model="radio1">
    <el-radio :label="5">默认收货地址</el-radio>
    <el-radio :label="10">收货地址一</el-radio>
  </el-radio-group>
  <el-button style="margin-left:50px" @click="address()" type="primary" size="small">新增收货地址</el-button>
<div>
    <h5>请选择支付方式:</h5>
    <el-radio-group v-model="radio2">
    <el-radio :label="3">支付宝</el-radio>
    <el-radio :label="6">微信</el-radio>
    <el-radio :label="9">银行卡</el-radio>
  </el-radio-group>
</div>
<el-button style="margin-top:20px" @click="pay()" type="primary" size="small">付款</el-button>
</div>

  
</template>

<script>
import{buy} from "../../service/order"
    import {mapState, mapMutations, mapActions} from "vuex";
import Head from "../cart/head"
export default {
  components:{Head},
data () {
      return {
        radio1: 5,
        radio2: 3,
       userInfo:{userId:0,userSerial:""} 
      };
      
    },
    computed:{
        ...mapState("cart",["user"])
    },
    methods:{
      //付款
      async pay(){
        await buy(this.user);
alert("付款成功")
        this.$router.push("/order")
      },
     
        ...mapActions("order", ["addOrder"]),
        
        //新增收货地址
    },
    
}
</script>

<style>

</style>